import React from 'react'
import Css from '../style/common.module.css'
import My from '../img/我的.png'

class Danqu extends React.Component {
  constructor(){
    super()
    this.state={
      arr:[]
    }
  }
componentWillMount(){
    // console.log(this.props)
    let {name}=this.props
    fetch(`http://106.12.79.128:666/search?keywords=${name}&type=100`)
    .then(body=>body.json())
    .then(res=>{
        console.log(res.result.artists)
        this.setState({
          arr:res.result.artists
        })
    })
}
  render() {
    return (
        <div>
            {this.state.arr.map((item,index)=>{
                return( 
                    <div className={Css.singer} key={index}>
                        <img src={item.img1v1Url} alt=""className={Css.singerImg} />
                        <p className={Css.singerP}>{item.name}</p>
                        <div className={Css.singerRight}>
                            {/* <div className={Css.showMy}> */}
                            <div className={item.mvSize==0?Css.showMy:Css.hiddenMy}>
                                <img src={My} alt="" className={Css.myImg} />
                            </div>
                            {/* <p className={Css.myP}>已入驻</p> */}
                            <p className={item.mvSize==0?Css.showmyP:Css.hiddenmyP}>已入驻</p>
                        </div>
                    </div>
                )
            })
            }
        </div>
    );
  }
}

export default Danqu